package cn.weiyuanbiao.DbGeneralCore.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class PropsUtils {

    public static String getValue(String key) {
        Properties props = new PropsUtils().getProps();
        return props.getProperty(key);
    }

    public Properties getProps() {
        try {
        Properties pro = new Properties();
        InputStream io = PropsUtils.class.getClassLoader().getResourceAsStream("config.properties");
            pro.load(io);
            return pro;
        } catch (IOException e) {
            e.printStackTrace();
            return null;
        }
    }

    public static void main(String[] args) {
        String url = PropsUtils.getValue("jdbc.url");
        System.out.println(url);
    }
}
